home *** CD-ROM | disk | FTP | other *** search
- REQUIREMENTS :
- ~~~~~~~~~~~~~~
- Amiga E v3.0 and kickstart 1.3 or better.
-
-
- INTRODUCTION :
- ~~~~~~~~~~~~~~
- debug.m is the E module equivalent to the C linked library debug.lib.
- If you already know this linked library, you can skip this introduction
- and directly go to the TECHNICAL section.
- For those who don't know this link library, let me give you a little
- explanation of its interest. Indeed, it contains simple input/output
- functions for the serial port. Thanks to them, you can use a remote debug-
- ging terminal linked to your Amiga via the serial port. But nobody have
- a debugging terminal linked to his Amiga :-) So a solution is to used
- Sushi which is developper tool (but also available on aminet) to intercept
- raw serial debugging output and to redirect it to a simple CON window.
- So every Amiga can take benefit from these function. But what is the
- interest for a sample Amiga E user in relation to the WriteF() procedure ?
- I see two advantages :
- - debugging output isn't mixed with normal output
- - you can't use functions like WriteF(), PrintF(), etc (in fact, all
- the dos.library function) outside a process context, in other words, you
- MUST use debug.m functions instead for exec tasks, devices, handlers, etc
-
-
- EXAMPLE USING :
- ~~~~~~~~~~~~~~~
- MODULE 'Tools/debug' -> of course you have put debug.m in EMODULES:Tools
-
- PROC main()
-
- DEF var , str[ 100 ] : STRING
-
- -> a lot of critical calculations around var and str
-
- kputfmt( 'var = \d & str = \s\n' , [ var , str ] )
- -> breath deeply : you know now what var and str are :-)
- -> note that you called kputfmt() exactly as you would have done
- -> for vprintf(), simple isn't it ?
-
- -> let's continue again critical things !
-
- ENDPROC
-
-
- TECHNICAL :
- ~~~~~~~~~~~
- The procedures of debug.m are :
- - kcmpstr( str1 : PTR TO CHAR , str2 : PTR TO CHAR )
- - char := kgetchar()
- - number := kgetnum()
- - char := kmaygetchar()
- - kputfmt( format_string : PTR TO CHAR , data_stream : PTR TO LONG )
- - kputchar( char )
- - kputstr( str : PTR TO CHAR )
- For further details, buy and read The Amiga Guru Book, an excellent
- book.
-
- To do debug.m, I disassembled debug.lib, modified a bit the resulting
- source (in fact I removed useless things for E users and adapted parameters
- passing to E rules), reassembled it and finally used o2m.
-
- DISTRIBUTION & DISCLAIMER :
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~
- This archive is completely public domain : DO WHAT YOU WANT WITH IT !
-
- However, I cannot be held responsible for the use of these files and
- any damages that they may cause directly or not. I want this to be clear :
- YOU USE THEM AT YOUR OWN RISK !
-
-
- Lionel Vintenat (vintenat@reseau.onecert.fr)
-